package com.shiwaixiangcun.authz.dto;

import com.alibaba.fastjson.annotation.JSONField;
import com.shiwaixiangcun.core.domain.oauth.AccessToken;

/**
 * Created by Administrator on 2017/3/31.
 */
public class LoginSuccessResponse {

    @JSONField(name = "access_token")
    private String accessToken;

    @JSONField(name = "refresh_token")
    private String refreshToken;

    @JSONField(name = "token_type")
    private String tokenType;

    @JSONField(name = "expires_in")
    private Integer expiresIn;

    public LoginSuccessResponse(AccessToken accessToken) {
        this.accessToken = accessToken.getTokenId();
        this.refreshToken= accessToken.getRefreshToken();
        this.tokenType = accessToken.getTokenType();
        this.expiresIn = accessToken.getTokenExpiredSeconds();
    }

    public String getAccessToken() {
        return accessToken;
    }

    public void setAccessToken(String accessToken) {
        this.accessToken = accessToken;
    }

    public String getRefreshToken() {
        return refreshToken;
    }

    public void setRefreshToken(String refreshToken) {
        this.refreshToken = refreshToken;
    }

    public String getTokenType() {
        return tokenType;
    }

    public void setTokenType(String tokenType) {
        this.tokenType = tokenType;
    }

    public Integer getExpiresIn() {
        return expiresIn;
    }

    public void setExpiresIn(Integer expiresIn) {
        this.expiresIn = expiresIn;
    }
}
